package com.java.module.chat.domain.dto;

import javax.validation.constraints.NotNull;

import com.java.module.chat.domain.ChatMessage;
import org.apache.commons.lang3.builder.ToStringBuilder;

import com.java.common.lang.annotation.Excel;

/**
 * 聊天：消息对象 chat_message
 * 
 * @author Administrator
 * @date 2021-05-13
 */
public class ChatMessageDTO {

    /** $column.columnComment */
    private Long messageId;

    /** 消息id */
    private Long sessionId;

    /** $column.columnComment */
    private Long adminSessionId;

    /** 客服对象：0售前 1售中 2售后 */
    @NotNull(message = "客服对象为空")
    private Integer chatType;

    /** 消息类型：1文本 2图片 */
    private Integer msgType;

    /** 发送者uid */
    @NotNull(message = "发送者为空")
    private Long msgFromUid;

    /** 接收者uid */
    private Long msgToUid;

    /** 消息内容 */
    @Excel(name = "消息内容")
    @NotNull(message = "消息内容为空")
    private String msgContent;

    /** 类型 0用户 1后台 */
    @NotNull(message = "消息类型为空")
    private Integer userType;

    private Integer sessionType;

    private Integer duration;
    
    private ChatMessage.MsgExtra msgExtra;

    public ChatMessage.MsgExtra getMsgExtra() {
        return msgExtra;
    }

    public void setMsgExtra(ChatMessage.MsgExtra msgExtra) {
        this.msgExtra = msgExtra;
    }

    public Long getMessageId() {
        return messageId;
    }

    public void setMessageId(Long messageId) {
        this.messageId = messageId;
    }

    public Long getSessionId() {
        return sessionId;
    }

    public void setSessionId(Long sessionId) {
        this.sessionId = sessionId;
    }

    public Long getAdminSessionId() {
        return adminSessionId;
    }

    public void setAdminSessionId(Long adminSessionId) {
        this.adminSessionId = adminSessionId;
    }

    public Integer getChatType() {
        return chatType;
    }

    public void setChatType(Integer chatType) {
        this.chatType = chatType;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public void setMsgType(Integer msgType) {
        this.msgType = msgType;
    }

    public Long getMsgFromUid() {
        return msgFromUid;
    }

    public void setMsgFromUid(Long msgFromUid) {
        this.msgFromUid = msgFromUid;
    }

    public Long getMsgToUid() {
        return msgToUid;
    }

    public void setMsgToUid(Long msgToUid) {
        this.msgToUid = msgToUid;
    }

    public String getMsgContent() {
        return msgContent;
    }

    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer uType) {
        this.userType = uType;
    }

    public Integer getSessionType() {
        return sessionType;
    }

    public void setSessionType(Integer sessionType) {
        this.sessionType = sessionType;
    }

    @Override
    public String toString() {
        ToStringBuilder builder = new ToStringBuilder(this);
        builder.append("messageId", messageId);
        builder.append("sessionId", sessionId);
        builder.append("adminSessionId", adminSessionId);
        builder.append("chatType", chatType);
        builder.append("msgType", msgType);
        builder.append("msgFromUid", msgFromUid);
        builder.append("msgToUid", msgToUid);
        builder.append("msgContent", msgContent);
        builder.append("userType", userType);
        builder.append("sessionType", sessionType);
        return builder.toString();
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }
}